import Vue from 'vue'
import Vuex from 'vuex'

import mutations from './mutations'
import actions from './actions'
import getters from './getters'
import state from './state'

import createLooger from 'vuex/dist/logger'
import vuexToLocalStorage from '@/assets/js/vuexCache'

Vue.use(Vuex);

const debug = process.env.NOOE_ENV !== 'production'

export default new Vuex.Store({
	actions,
	getters,
	state,
	mutations,
	strict: debug,
	plugins: debug ? [createLooger(), vuexToLocalStorage]:[vuexToLocalStorage]
});